Skip to content

Add SQL Server 2025 to integration tests#2435

Merged
johlju merged 29 commits intodsccommunity:mainfrom
johlju:f/sql-2025-test
Jan 28, 2026
Merged

Add SQL Server 2025 to integration tests#2435
johlju merged 29 commits intodsccommunity:mainfrom
johlju:f/sql-2025-test

Conversation

@johlju
Copy link
Copy Markdown
Member

@johlju johlju commented Jan 24, 2026

Pull Request (PR) description

  • SqlServerDsc
    • Add SQL Server 2025 to integration tests (issue #2427).

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 24, 2026

Walkthrough

Comprehensive addition of SQL Server 2025 support to the integration test matrix, including CI/CD pipeline updates, compatibility level enhancements, version-aware logic for SQL 2025 (major version 17), and updated test coverage across integration and unit tests with new Integration_SQL2025 tags.

Changes

Cohort / File(s) Summary
Documentation & Manifest
CHANGELOG.md, CONTRIBUTING.md
Updated to reference SQL Server 2025 integration tests and multiple separate integration test jobs (2017, 2019, 2022, 2025).
CI/CD Pipeline
azure-pipelines.yml
Added SQL2025_WIN2025 matrix entry with windows-2025 image across multiple integration stages (Integration Test Commands, Reporting Services, BI Report Server, DSCv3).
Compatibility Level Support
source/Classes/020.SqlDatabase.ps1, source/Public/New-SqlDscDatabase.ps1
Extended CompatibilityLevel ValidateSet to include Version170; added logic to convert numeric SMO values (e.g., 170) to Version-prefixed form (Version170); updated internal compatibility mapping for SQL Server 2025.
SQL Server Replication
source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1
Added InstanceName parameter to Install-RemoteDistributor; introduced version-aware branch for SQL Server 17 using T-SQL workaround (sp_adddistributor); extended server connection logic to versions 16 and 17.
Setup Version Handling
source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1
Extended conditional branches to include version 17 in shared path clearing and retrieval logic.
Integration Test Tags (Bulk)
tests/Integration/Commands/*.Tests.ps1 (80+ files), tests/Integration/Resources/*.Tests.ps1 (20+ files), tests/Integration/Private/*.Tests.ps1
Added Integration_SQL2025 tag to Describe blocks across all command, resource, and private integration test files, expanding test matrix from SQL 2017/2019/2022 to include 2025.
Prerequisites & Setup Tests
tests/Integration/Commands/Prerequisites.Integration.Tests.ps1, tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1
Added SQL Server 2025 media download, mounting, and TLS 1.2 validation tests; extended version-conditional logic to handle VersionMajor 17; introduced new context blocks for 2025-specific setup scenarios.
Setup Configuration
tests/Integration/Resources/DSC_SqlSetup.config.ps1
Added version 170 branch with SQL Server 2025 instance ID prefixes, ISO/download names, supported features (SQLENGINE, REPLICATION), and module versions (SqlServer 22.4.5.1, dbatools 2.0.1).
Unit Tests
tests/Unit/Public/Get-SqlDscCompatibilityLevel.Tests.ps1, tests/Unit/Public/New-SqlDscDatabase.Tests.ps1
Added test contexts and cases for SQL Server major version 17 (2025), validating compatibility levels (100–170) and ledger database support.
Test Helpers & Mocks
tests/TestHelpers/CommonTestHelper.psm1, tests/Unit/SqlServerDsc.Common/Public/Connect-SQL.Tests.ps1
Added certificate import logic to LocalMachine\Root trusted root store in New-SQLSelfSignedCertificate; added EncryptConnection mock property to connection test objects.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #2327: Modifies database compatibility-level handling to add SQL Server 2025/Version170 support (ValidateSet, compatibility-level logic/tests) — overlaps with changes to SqlDatabase and New-SqlDscDatabase compatibility logic.
  • PR #2350: Both PRs modify source/Public/New-SqlDscDatabase.ps1 parameter validation and compatibility mapping — directly related through the same function updates.
  • PR #2404: Both PRs modify CI pipeline configurations (azure-pipelines.yml) to expand integration test coverage and update changelogs — related infrastructure changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive While most changes support SQL Server 2025 integration testing, some modifications (CompatibilityLevel extensions, InstanceName parameter in Install-RemoteDistributor, TLS helper functions) appear beyond the core requirement of adding SQL Server 2025 to the test matrix. Clarify whether InstanceName parameter requirement and compatibility level updates are necessary for SQL Server 2025 support or are separate enhancements.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add SQL Server 2025 to integration tests' accurately and concisely summarizes the main change: adding SQL Server 2025 support to the integration test matrix.
Description check ✅ Passed The description directly relates to the changeset, referencing the primary change (adding SQL Server 2025 to integration tests) and linking to issue #2427.
Linked Issues check ✅ Passed The PR successfully addresses issue #2427 by adding SQL Server 2025 to the integration test matrix, updating all relevant integration test tags, and providing configuration for the new SQL Server version.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread source/Public/Test-TlsProtocol.ps1 Fixed
Comment thread source/Public/Test-TlsProtocol.ps1 Fixed
Comment thread source/Public/Test-TlsProtocol.ps1 Fixed
Comment thread source/Public/Test-TlsProtocol.ps1 Fixed
Comment thread source/Public/Test-TlsProtocol.ps1 Fixed
Comment thread source/Public/Test-TlsProtocol.ps1 Fixed
Comment thread source/Public/Test-TlsProtocol.ps1 Fixed
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 24, 2026

Codecov Report

❌ Patch coverage is 41.17647% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 94%. Comparing base (19c7f47) to head (aa49742).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...sources/DSC_SqlReplication/DSC_SqlReplication.psm1 10% 9 Missing ⚠️
source/Classes/020.SqlDatabase.ps1 75% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2435   +/-   ##
=====================================
- Coverage     94%     94%   -1%     
=====================================
  Files        225     225           
  Lines      10759   10769   +10     
=====================================
+ Hits       10139   10142    +3     
- Misses       620     627    +7     
Flag Coverage Δ
unit 94% <41%> (-1%) ⬇️
Files with missing lines Coverage Δ
source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 98% <100%> (ø)
source/Public/New-SqlDscDatabase.ps1 66% <100%> (+<1%) ⬆️
source/Classes/020.SqlDatabase.ps1 89% <75%> (-1%) ⬇️
...sources/DSC_SqlReplication/DSC_SqlReplication.psm1 62% <10%> (-4%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread source/Private/Get-TlsProtocolRegistryPath.ps1 Fixed
Comment thread source/Private/Get-TlsProtocolTargetRegistryName.ps1 Fixed
Comment thread source/Private/Get-TlsProtocolTargetRegistryName.ps1 Fixed
@johlju johlju added the needs review The pull request needs a code review. label Jan 25, 2026
@johlju
Copy link
Copy Markdown
Member Author

johlju commented Jan 25, 2026

We are getting error: SSL Provider: The certificate chain was issued by an authority that is not trusted.

This is probably due to breaking changes mentioned in Replication components fail after an upgrade and particular for this error with Install-RemoteDistributor it is probably Adding a remote replication distributor fails.

Logs:

Context When using configuration DSC_SqlReplication_AddPublisher_Config
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = 
SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = 
root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer runnervm72i71 with user sid 
S-1-5-21-2352410390-259027302-1052514532-500.
VERBOSE: [runnervm72i71]: LCM:  [ Start  Set      ]
VERBOSE: [runnervm72i71]: LCM:  [ Start  Resource ]  [[SqlReplication]Integration_Test]
VERBOSE: [runnervm72i71]: LCM:  [ Start  Test     ]  [[SqlReplication]Integration_Test]
VERBOSE: [runnervm72i71]:                            [[SqlReplication]Integration_Test] Determines if the distribution 
is configured in desired state.
VERBOSE: [runnervm72i71]:                            [[SqlReplication]Integration_Test] Get the current state of the 
server replication configuration for the instance 'MSSQLSERVER'.
VERBOSE: [runnervm72i71]:                            [[SqlReplication]Integration_Test] Loading module from path 
'D:\a\1\s\output\builtModule\SqlServerDsc\17.5.0\Modules\DscResource.Base\2.0.0\DscResource.Base.psm1'.
VERBOSE: [runnervm72i71]:                            [[SqlReplication]Integration_Test] There are currently no 
distributor mode set for the instance 'MSSQLSERVER'.
VERBOSE: [runnervm72i71]: LCM:  [ End    Test     ]  [[SqlReplication]Integration_Test]  in 3.0450 seconds.
VERBOSE: [runnervm72i71]: LCM:  [ Start  Set      ]  [[SqlReplication]Integration_Test]
VERBOSE: [runnervm72i71]:                            [[SqlReplication]Integration_Test] The remote distribution will be
 configured.
VERBOSE: [runnervm72i71]:                            [[SqlReplication]Integration_Test] Creating the distributor 
publisher 'runnervm72i71' on the instance 'runnervm72i71\DSCSQLTEST'.
VERBOSE: [runnervm72i71]:                            [[SqlReplication]Integration_Test] Installing the remote 
distributor 'runnervm72i71\DSCSQLTEST'.
##[error]    [-] Should compile and apply the MOF without throwing 5.17s (5.16s|9ms)
##[error]     CimException: System.InvalidOperationException: The call to 'Install-RemoteDistributor' failed. ---> System.Management.Automation.MethodInvocationException: Exception calling "InstallDistributor" with "2" argument(s): "An exception occurred while executing a Transact-SQL statement or batch." ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> Microsoft.Data.SqlClient.SqlException: SSL Provider: The certificate chain was issued by an authority that is not trusted.
##[error]     Changed database context to 'master'.
##[error]     OLE DB provider "MSOLEDBSQL19" for linked server "repl_distributor" returned message "Client unable to establish connection. For solutions related to encryption errors, see [https://go.microsoft.com/fwlink/?linkid=2227882.".](https://go.microsoft.com/fwlink/?linkid=2227882.%22.)
##[error]        at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
##[error]        at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
##[error]        at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
##[error]        at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
##[error]        at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
##[error]        at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
##[error]        at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
##[error]        at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
##[error]        --- End of inner exception stack trace ---
##[error]        at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
##[error]        at Microsoft.SqlServer.Replication.ReplicationObject.ExecCommand(String commandIn)
##[error]        at Microsoft.SqlServer.Replication.ReplicationServer.InstallDistributor(String distributionServerName, String password)
##[error]        at CallSite.Target(Closure , CallSite , Object , String , Object )
##[error]        --- End of inner exception stack trace ---
##[error]        at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
##[error]        at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
##[error]        at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[error]        at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[error]        --- End of inner exception stack trace ---
##[error]     at <ScriptBlock>, D:\a\1\s\tests\Integration\Resources\DSC_SqlReplication.Integration.Tests.ps1:175

johlju added 19 commits January 26, 2026 18:48
@johlju johlju marked this pull request as ready for review January 28, 2026 11:36
@johlju johlju requested a review from a team as a code owner January 28, 2026 11:36
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1 (1)

602-665: Escape distributor/password values before embedding in T‑SQL.
Unescaped values can break the statement (e.g., single quotes) or allow injection. Escape or parameterize before composing the query.

🛠️ Suggested fix (escape single quotes)
-        $clearTextPassword = $AdminLinkCredentials.GetNetworkCredential().Password
+        $clearTextPassword = $AdminLinkCredentials.GetNetworkCredential().Password
+        $escapedDistributor = $RemoteDistributor.Replace("'", "''")
+        $escapedPassword = $clearTextPassword.Replace("'", "''")

-        $query = "EXECUTE sys.sp_adddistributor `@distributor` = N'$RemoteDistributor', `@password` = N'$clearTextPassword', `@encrypt_distributor_connection` = 'optional', `@trust_distributor_certificate` = 'yes';"
+        $query = "EXECUTE sys.sp_adddistributor `@distributor` = N'$escapedDistributor', `@password` = N'$escapedPassword', `@encrypt_distributor_connection` = 'optional', `@trust_distributor_certificate` = 'yes';"
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Around line 15-17: Update the Unreleased → Changed list in CHANGELOG.md to
contain no more than two items by consolidating or removing one of the three
current bullets (referencing the entries for Connect-Sql, Invoke-SqlDscQuery,
and SQL Server 2025); also format the product name "SQL Server 2025" in italics
(i.e., _SQL Server 2025_) so the CHANGELOG uses italicized product/module names
consistently.

In `@tests/Integration/Resources/DSC_SqlReplication.Integration.Tests.ps1`:
- Line 53: The AddPublisher_Config test context must be skipped for SQL Server
2025 due to ODBC/encryption changes; update the Context declaration named
"AddPublisher_Config" to include a -Skip parameter that excludes the
'Integration_SQL2025' tag (e.g., -Skip @('Integration_SQL2025')), following the
same pattern used in DSC_SqlSetup.Integration.Tests.ps1 so the
AddPublisher_Config context will not run for the Integration_SQL2025 tag.

In `@tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1`:
- Around line 258-267: The test Context 'Ensure TLS 1.2 is enabled' is marked
with an unconditional -Skip so the precheck never runs; remove the -Skip (or
make it conditional) on that Context declaration so the assertions using
Test-TlsProtocol (and the client variant Test-TlsProtocol -Client) execute
during Integration_SQL2025 runs; locate the Context block named 'Ensure TLS 1.2
is enabled' and either delete the -Skip token or replace it with a conditional
expression that only skips when appropriate for non-SQL2025 pipelines.
🧹 Nitpick comments (9)
tests/Integration/Resources/DSC_SqlAlwaysOnService.Integration.Tests.ps1 (1)

69-73: Good: Using -Skip switch is correct Pester v5 syntax.

The change from -Tag 'Skip' to -Skip is appropriate—the -Skip switch actually skips test execution, whereas -Tag 'Skip' only labels the test without skipping it.

However, since this PR adds SQL Server 2025 to integration tests, consider updating the TODO comment to include Integration_SQL2025 in the tag list for when this test is re-enabled.

Also, there's a double space before the opening brace on line 73.

📝 Suggested update
 <#
     TODO: This has temporarily been disabled as the test is not passing.
-          Tags should be changed to @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022')
+          Tags should be changed to @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025')
 #>
-Describe "$($script:dscResourceName)_Integration" -Skip  {
+Describe "$($script:dscResourceName)_Integration" -Skip {
tests/Integration/Commands/Set-SqlDscDatabaseDefault.Integration.Tests.ps1 (1)

116-120: Consider moving database cleanup to AfterAll.

The test database removal is currently in an It block, which may not execute if earlier tests fail. Moving this to the AfterAll block (lines 65-68) ensures cleanup runs reliably regardless of test outcomes.

♻️ Suggested refactor
     AfterAll {
+        # Clean up the test database
+        $null = Remove-SqlDscDatabase -ServerObject $script:serverObject -Name $script:testDatabaseName -Force
+
         # Disconnect from the database engine.
         Disconnect-SqlDscDatabaseEngine -ServerObject $script:serverObject
     }

Then remove the cleanup Context block (lines 116-120).

tests/Integration/Commands/Get-SqlDscTraceFlag.Integration.Tests.ps1 (1)

39-42: Consider removing unused credential variable.

$script:mockSqlAdminCredential is defined but never used in any test. The Get-SqlDscTraceFlag command uses WMI/Configuration Manager and doesn't require database credentials.

♻️ Suggested cleanup
     BeforeAll {
         $script:mockInstanceName = 'DSCSQLTEST'
         $script:mockComputerName = Get-ComputerName
 
-        $mockSqlAdministratorUserName = 'SqlAdmin' # Using computer name as NetBIOS name throw exception.
-        $mockSqlAdministratorPassword = ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force
-
-        $script:mockSqlAdminCredential = [System.Management.Automation.PSCredential]::new($mockSqlAdministratorUserName, $mockSqlAdministratorPassword)
-
         # Get the service object for testing the ByServiceObject parameter set
         $script:serviceObject = Get-SqlDscManagedComputerService -ServiceType 'DatabaseEngine' -InstanceName $script:mockInstanceName -ErrorAction 'Stop'
     }
tests/Unit/SqlServerDsc.Common/Public/Connect-Sql.Tests.ps1 (1)

408-414: Consider verifying EncryptConnection property when using -Encrypt switch.

The test validates the connection instance but doesn't assert that EncryptConnection is set correctly when the -Encrypt parameter is used.

💡 Suggested enhancement
         It 'Should return the correct service instance' -Skip:($IsLinux -or $IsMacOS) {
             $databaseEngineServerObject = Connect-SQL -Encrypt -ServerName $mockExpectedDatabaseEngineServer -InstanceName $mockExpectedDatabaseEngineInstance -ErrorAction 'Stop'
             $databaseEngineServerObject.ConnectionContext.ServerInstance | Should -BeExactly "$mockExpectedDatabaseEngineServer\$mockExpectedDatabaseEngineInstance"
+            $databaseEngineServerObject.ConnectionContext.EncryptConnection | Should -BeTrue

             Should -Invoke -CommandName New-Object -Exactly -Times 1 -Scope It `
                 -ParameterFilter $mockNewObject_MicrosoftDatabaseEngine_ParameterFilter
         }
tests/Integration/Commands/Prerequisites.Integration.Tests.ps1 (1)

272-281: Remove redundant tag from inner It block.

The -Tag @('Integration_SQL2025') on Line 275 is redundant since the parent Context block at Line 272 already has this tag. Pester inherits tags from parent blocks.

♻️ Suggested fix
     Context 'Ensure TLS 1.2 is enabled' -Tag @('Integration_SQL2025') -Skip {
         # SQL Server 2025 installation can fail when TLS 1.2 is disabled:
         # https://learn.microsoft.com/en-us/sql/sql-server/sql-server-2025-known-issues?view=sql-server-ver17#sql-server-2025-installation-fails-when-tls-12-is-disabled
-        It 'Should have TLS 1.2 enabled on the node' -Tag @('Integration_SQL2025') {
+        It 'Should have TLS 1.2 enabled on the node' {
             # Test-TlsProtocol returns $true when the protocol is enabled.
             # Assert for both Server and Client registry keys.
             (Test-TlsProtocol -Protocol 'Tls12') | Should -BeTrue
             (Test-TlsProtocol -Protocol 'Tls12' -Client) | Should -BeTrue
         }
     }
tests/Integration/Resources/DSC_SqlSecureConnection.Integration.Tests.ps1 (1)

67-67: Consider adding a comment explaining why SQL Server 2025 is excluded.

The Integration_SQL2025 tag is intentionally commented out, which aligns with the PR comments about SSL/certificate trust errors in SQL Server 2025. Adding an inline comment block above this line would help future maintainers understand the exclusion reason and when it might be safe to re-enable.

💡 Suggested improvement
+<#
+    SQL Server 2025 is excluded due to certificate/SSL trust issues.
+    See: https://learn.microsoft.com/sql/relational-databases/replication/
+    "Adding a remote replication distributor fails" section.
+    TODO: Re-enable when certificate trust handling is resolved.
+#>
 Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') { # 'Integration_SQL2025'
tests/Integration/Commands/Remove-SqlDscAgentOperator.Integration.Tests.ps1 (1)

43-43: Consider using array syntax for tag consistency.

The Integration_SQL2025 tag addition is correct. However, this file uses comma-separated tags without the array wrapper, while other integration tests in this PR use @(...) array syntax. Both are valid, but using array syntax would improve consistency across the codebase.

🔧 Suggested change for consistency
-Describe 'Remove-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' {
+Describe 'Remove-SqlDscAgentOperator' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') {
tests/Integration/Commands/Enable-SqlDscAgentOperator.Integration.Tests.ps1 (1)

43-43: Consider using array syntax for consistency.

The tag addition is correct. However, this file uses comma-separated values without the @() array wrapper, while other integration test files in this PR use @('tag1', 'tag2', ...) syntax.

🔧 Optional fix for consistency
-Describe 'Enable-SqlDscAgentOperator' -Tag 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025' {
+Describe 'Enable-SqlDscAgentOperator' -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_SQL2025') {

As per coding guidelines: "For single-line arrays use: @('one', 'two', 'three')"

tests/TestHelpers/CommonTestHelper.psm1 (1)

326-336: Good addition to address SQL Server 2025 certificate trust requirements.

This change addresses the SSL certificate chain trust error mentioned in the PR comments for SQL Server 2025 replication tests. Importing the self-signed certificate into Cert:\LocalMachine\Root ensures the certificate is trusted for SQL Server connections that require encryption.

Minor observation: Line 330 uses double backslashes (Cert:\\LocalMachine\\Root) in the verbose message, which will display literally. This is cosmetic only.

🔧 Optional fix for consistent path display
-        Write-Verbose -Message ('Imported certificate into Cert:\\LocalMachine\\Root with thumbprint ''{0}''.' -f $certificate.Thumbprint)
+        Write-Verbose -Message ('Imported certificate into Cert:\LocalMachine\Root with thumbprint ''{0}''.' -f $certificate.Thumbprint)

Comment thread CHANGELOG.md
Comment thread tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1
Copy link
Copy Markdown
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@johlju reviewed 153 files and all commit messages, made 1 comment, and resolved 13 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju).

Comment thread source/DSCResources/DSC_SqlReplication/DSC_SqlReplication.psm1
@johlju johlju merged commit dfe01bc into dsccommunity:main Jan 28, 2026
31 of 60 checks passed
@johlju johlju deleted the f/sql-2025-test branch January 28, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review The pull request needs a code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use SQL Server 2025 in integration tests

2 participants